cmake_minimum_required(VERSION 3.24)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_SHARED_LIBRARY_PREFIX "")

include_directories(include)

add_subdirectory(core)

add_executable(lewc main.cpp
        Option.cpp include/Option.h
        Reader.cpp include/Reader.h
        core/Word.cpp include/Word.h
        core/core.cpp include/core.h
        core/Compute.cpp include/Compute.h
        core/WordChain.cpp include/WordChain.h
        core/SCComponent.cpp include/SCComponent.h)

add_library(lib SHARED
        Option.cpp include/Option.h
        Reader.cpp include/Reader.h)


install(TARGETS lib
        RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/bin/
        LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/bin/
        )
install(TARGETS core
        RUNTIME DESTINATION ${PROJECT_SOURCE_DIR}/bin/
        LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/bin/
        )

target_link_libraries(lewc core lib)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)